#!/bin/sh

# Delete old Deja Vu, since we're installed in /Library/PreferencePanes now
rm -rf ~/Library/PreferencePanes/DejaVu.prefPane
rm -f ~/Library/Caches/com.apple.preferencepanes.cache

# Delete old Deja Vu folder (moved to /Library/Application Support/Deja Vu)
rm -rf ~/Library/Application\ Support/Deja\ Vu

# Delete prefs (Roxio build only)
rm -f ~/Library/Preferences/com.propaganda.DejaVuPref.plist

# Fix the setuid bits on our background tools
chown root:wheel /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/install_scripts
chmod u+s /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/install_scripts
chown root:wheel /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/remove_scripts
chmod u+s /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/remove_scripts
chown root:wheel /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/install_crontab
chmod u+s /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/install_crontab
chown root:wheel /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/manual_backup
chmod u+s /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/manual_backup
chown root:wheel /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/archive_table
chmod u+s /Library/PreferencePanes/DejaVu.prefPane/Contents/Resources/archive_table

# Fix directory ownerships/permissions
chown root.admin /Library
chmod 775 /Library /Library/PreferencePanes /Library/PreferencePanes/DejaVu.prefPane

# Give them a clue where to find Deja Vu
##open /Library/PreferencePanes/DejaVu.prefPane
